﻿@model IEnumerable<GoDinner.Models.Reservering>

@{
    ViewBag.Title = "OverzichtOrders";
}

<h2>OverzichtOrders</h2>

<table id="tableGerechten">
    <tr>
        <th>
            <label>#</label>
        </th>
        <th>
            <label>Klantnaam</label>
        </th>
        <th>
            <label>Goedgekeurd</label>
        </th>
        <th>
            <label>Totaal bedrag</label>
        </th>
        <th>
            <label>Datum</label>
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Id)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.User.UserName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.IsGoedgekeurd)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.TotaalBedrag)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.datum)
        </td>
        <td>
            @Html.ActionLink("Bekijk details","OrderDetail","Reservation",  new { id=item.Id },null)
            @if (item.IsGoedgekeurd == false)
            {
                @Html.ActionLink("Goedkeuren", "Approve", "Reservation", new { id = item.Id }, null)    
            }
            
        </td>
    </tr>
}

</table>
